/**
 * Copyright(c) by JNet Smartware Group.
 * All rights reserved. Not distribution or redistribution without
 * any permission of JNet Smartware Group.
 * 
 * @author thuc
 * 2010/03/15
 */
package vn.smartware.co.server.sql.factory;

import java.sql.Connection;

import vn.smartware.co.framework.bean.LoginDTO;
import vn.smartware.co.framework.db.factory.SQLManager;
import vn.smartware.co.framework.exception.ServerException;
import vn.smartware.co.framework.form.LoginForm;

/**
 * @author thuctt
 *
 */
public abstract class AbstractLoginSQLManager extends SQLManager {

	/**
	 * check login name exist
	 * 
	 * @param form
	 * @param conn
	 * @throws ServerException
	 */
	abstract public void makeChkUserNameExistSQL(LoginForm form, Connection conn) throws ServerException;
	
	/**
	 * check account exist
	 * 
	 * @param form
	 * @param conn
	 * @throws ServerException
	 */
	abstract public void makeGetLoginInfoSQL(LoginForm form, Connection conn) throws ServerException;

	/**
	 * increase number of trying login
	 * @param form
	 * @param conn
	 * @throws ServerException
	 */
	abstract public void makeIncreaseTryNumberSQL(LoginForm form,
			Connection conn) throws ServerException;

	/**
	 * get user login info
	 * 
	 * @param form
	 * @param conn
	 * @throws ServerException
	 */
	abstract public void makeGetUserInfoSQL(LoginForm form, Connection conn)
			throws ServerException;

	/**
	 * count login number SQL
	 * 
	 * @param form
	 * @param conn
	 * @throws ServerException
	 */
	abstract public void makeCountLoginTryNumberSQL(LoginForm form,
			Connection conn) throws ServerException;

	/**
	 * create first login time
	 * 
	 * @param form
	 * @param conn
	 * @throws ServerException
	 */
	abstract public void makecreateFirstLoginTimeSQL(LoginForm form,
			Connection conn) throws ServerException;

	/**
	 * reset trying number to 0
	 * @param form
	 * @param conn
	 * @throws ServerException
	 */
	abstract public void makeUpdateLoginSucessfulStatusSQL(LoginForm form,
			Connection conn) throws ServerException;

	/**
	 * lock account
	 * @param form
	 * @param conn
	 * @throws ServerException
	 */
	abstract public void makeLockAccountSQL(LoginForm form, Connection conn)
			throws ServerException;

	/**
	 * check account locked
	 * @param form
	 * @param conn
	 * @throws ServerException
	 */
	abstract public void makeIsAccountLockedSQL(LoginForm form, Connection conn)
			throws ServerException;

	/**
	 * reset login status
	 * @param form
	 * @param conn
	 * @throws ServerException
	 */
	abstract public void makeResetLoginStatusSQL(LoginForm form, Connection conn)
			throws ServerException;

	/**
	 * get max login no
	 * @param conn
	 * @throws ServerException
	 */
	abstract public void makeGetMaxLoginNoSQL(Connection conn)
			throws ServerException;

	/**
	 * update logout time
	 * @param user
	 * @param conn
	 * @throws ServerException
	 */
	abstract public void makeSetLogoutTimerSQL(LoginDTO user, Connection conn)
			throws ServerException;

}
